package com.ellison.zookeeperdemo.lock2;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 订单工厂类，模拟创建订单
 *
 * @Author Ellison Pei
 * @Date 2021/6/30 21:16
 **/
public class OrderNumFactory {

    private static int i = 0;

    public String createOrderNum() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-");
        return simpleDateFormat.format(new Date()) + ++i;
    }
}
